package com.pickgliss.ui.core
{
	import com.pickgliss.ui.ShowTipManager;

	public class TransformableComponent extends Component implements ITransformableTipedDisplay
	{
		public static const P_tipWidth:String = "tipWidth";
		public static const P_tipHeight:String = "tipHeight";
		
		public function TransformableComponent()
		{
			super();
			tipGapH = 20;
			tipGapV = 20;
			isFollowMouse = false;
			tipDirctions="7,5,4,6";
		}
		
		protected var _tipWidth:int;
		protected var _tipHeight:int;
		
		public function get tipWidth():int
		{
			return _tipWidth;
		}
		
		public function set tipWidth(w:int):void
		{
			if(_tipWidth == w)return;
			_tipWidth = w;
			onPropertiesChanged(P_tipWidth);
		}
		
		public function get tipHeight():int{
			return _tipHeight;
		}
		
		public 	function set tipHeight(h:int):void{
			if(_tipHeight == h)return;
			_tipHeight = h;
			onPropertiesChanged(P_tipHeight);
		}
		
		override protected function onProppertiesUpdate():void
		{
			if(_changedPropeties[P_tipWidth] || _changedPropeties[P_tipHeight] || _changedPropeties[P_tipDirction] || _changedPropeties[P_tipGap] || _changedPropeties[P_tipStyle] || _changedPropeties[P_tipData])
			{
				ShowTipManager.Instance.addTip(this);
			}
		}
	}
}